package cn.tedu.submarine;

import java.util.Random;

/** 侦察潜艇 */
public class ObserveSubmarine {
    int width;
    int height;
    int x;
    int y;
    int speed;
    /** 构造方法 */
    ObserveSubmarine(){
        width = 63;
        height = 19;
        x = -width; //负的潜艇的宽
        Random rand = new Random(); //随机数对象
        y = rand.nextInt(479-height-150+1)+150; //150到(窗口高-潜艇高)的随机数
        speed = rand.nextInt(3)+1; //1到3的随机数
        /*
          y = rand.nextInt(311);     //0到310
          y = rand.nextInt(311)+150; //150到460
          y = rand.nextInt(460-150+1)+150;        //150到460
          y = rand.nextInt(479-height-150+1)+150; //150到460
         */
    }

    void move(){
        System.out.println("侦察潜艇的x向右移动");
    }
}
























